﻿using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
using Taype.Trading.BTC.Utilities;

namespace Taype.Trading.BTC.TradeHillAPIClient.JSONObjects
{

    /// <summary>
    /// Return: Dictionary containing a 'withdrawals' array. The withdrawals array contains dictionaries with the following fields:
    /// id: The unique ID of this withdrawal request.
    /// status: Status of the request.
    /// startdate: The date this request was submitted.
    /// finishdate: The date this request was completed, failed, or canceled.
    /// amountrequested: The amount which was requested to be withdrawn.
    /// amountapproved: The amount which was approved to be withdrawn, and was subsequently debited from the account.
    /// method: The method of withdraw.
    /// currency: The currency of the withdrawn money.
    /// box_a: Additional details specified in Box A of the request.
    /// box_b: Additional details specified in Box B of the request.
    /// box_c: Additional details specified in Box C of the request.
    /// box_d: Additional details specified in Box D of the request.
    /// box_e: Additional details specified in Box E of the request.
    /// box_f: Additional details specified in Box F of the request.
    /// box_g: Additional details specified in Box G of the request.
    /// </summary>
    public class TradeHillWithdrawal
    {

        public string id { get; set; }
        public string status { get; set; }
        public DateTime startdate { get; set; }
        public DateTime finishdate { get; set; }
        public double amountrequested { get; set; }
        public double amountapproved { get; set; }
        public TradeHillWithdrawalType method { get; set; }
        public TradeHillCurrencySymbol currency { get; set; }
        public string box_a { get; set; }
        public string box_b { get; set; }
        public string box_c { get; set; }
        public string box_d { get; set; }
        public string box_e { get; set; }
        public string box_f { get; set; }
        public string box_g { get; set; }

        public static List<TradeHillWithdrawal> getObjects(string jsonDataStr)
        {
            throw new NotImplementedException();
            List<TradeHillWithdrawal> tradeList = new List<TradeHillWithdrawal>();
            string json = jsonDataStr;
            var serializer = new JavaScriptSerializer();
            serializer.RegisterConverters(new[] { new DynamicJsonConverter() });
            dynamic obj = serializer.Deserialize(json, typeof(object));
            return tradeList;
        }
    }
}
